const Router = require('koa-router')
const { getUserManage, updateUserManage, getArticleColumn, updateArticleColumn } = require('../controller/manage.controller')
const { addArticleType, getArticleType, updateArticleType } = require('../controller/articleType.manage.controller')
const { getArticle, updateArticle } = require('../controller/client.controller')
const { saveCommunity, getCommunity, getCommunityAttention, saveCommunityAttention, getComConversation, saveComConversation,getCommunityUserNum } = require('../controller/community.controller')
const router = new Router({ prefix: '/manage' })
/***
 *   用户管理
 */

router.get('/getUserManage', getUserManage),
    router.post('/updateUserManage', updateUserManage)
/**
 *  文章类型管理
 */

router.post('/addArticleType', addArticleType)
router.get('/getArticleType', getArticleType)
// 返回值格式 {"code": 1000,"result": "error" } result : success/error
router.post('/updateArticleType', updateArticleType)


/**
 *   专栏管理
 */
router.get('/getArticleColumn', getArticleColumn)
router.post('/updateArticleColumn', updateArticleColumn)
/**
 *   文章审核
 */
// 获取文章列表
router.get('/getArticleMange', getArticle)
router.post('/updateArticle', updateArticle)

router.post('/saveCommunity', saveCommunity)
router.get('/getCommunity', getCommunity)

router.get('/getCommunityAttention', getCommunityAttention)
router.post('/saveCommunityAttention', saveCommunityAttention)
router.get('/getComConversation', getComConversation)
router.post('/saveComConversation', saveComConversation)
router.get('/getCommunityUserNum',getCommunityUserNum)



// 导出
module.exports = router